let vm = new Vue({
    el: '#rrapp',
    data: {
        showList: true,
        title: null,
        regularMaintenanceRecords: {
            delFlag: '',
            creater: '',
            createTime: '',
            effectConfirmer: '',
            effectConfirmTime: '',
            effectConfirmInfo: '',
            remake: '',
            productType: '',
            productSeries: '',
            operateTime: '',
            mainteAcceptTime: '',
            planMainteTime: '',
            lastMainteTime: '',
            isUpload: '1',
            reason: '',
            isStop: '1',
            mainteDept: '',
            mainteStaff: '',
            mainteTime: '',
            maintePlanId: '',
            id: '',
            file:''
        },
        ruleValidate: {
            name: [
                {required: true, message: '名称不能为空', trigger: 'blur'}
            ]
        },
        q: {
            name: ''
        },
        picUrl: ''
    },
    methods: {
        handleSuccess: function (res, file) {
            this.$Loading.finish();
            iview.Message.success('文件上传成功');
            vm.regularMaintenanceRecords.file = file.response.url;
            var url = vm.regularMaintenanceRecords.file;
            if (url) vm.picUrl = url.substring((url.lastIndexOf("\/") + 1), url.length);
        },
        handleError: function (file) {
            this.$Notice.warning({
                title: '文件格式不正确',
                desc: '文件 ' + file.name + ' 格式不正确，请上传格式正确的图片。'
            });
        },
        handleMaxSize: function (file) {
            this.$Notice.warning({
                title: '超出文件大小限制',
                desc: '文件 ' + file.name + ' 太大，不能超过 2M。'
            });
        },
        eyeFile: function (url) {
            if (url) {
                window.open(url);
            } else {
                alert('还未上传文件');
            }
        },

    }
});
getFormDates=function () {
    return vm.regularMaintenanceRecords;
}